package com.xbongbong.admin.model.impl;

import com.xbongbong.admin.domain.dao.ChartBindAppInfoDao;
import com.xbongbong.admin.domain.entity.ChartBindAppInfoEntity;
import com.xbongbong.admin.model.ChartBindAppInfoModel;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.util.DateUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @auther: xingxing.xiao
 * @date: 2020/3/9 009 16:55
 */
@Service("chartBindAppInfoModel")
public class ChartBindAppInfoModelImpl implements ChartBindAppInfoModel {

    @Resource
    private ChartBindAppInfoDao chartBindAppInfoDao;

    @Override
    public Integer insert(ChartBindAppInfoEntity entity) throws XbbException {
        long now = DateUtil.getInt();
        entity.setAddTime(now);
        entity.setUpdateTime(now);
        return chartBindAppInfoDao.insert(entity);
    }

    @Override
    public Integer update(ChartBindAppInfoEntity entity) throws XbbException {
        long now = DateUtil.getInt();
        entity.setUpdateTime(now);
        return chartBindAppInfoDao.update(entity);
    }

    @Override
    public List<ChartBindAppInfoEntity> findEntitys(Map<String, Object> param) {
        return chartBindAppInfoDao.findEntitys(param);
    }

    @Override
    public Integer getEntitysCount(Map<String, Object> param) {
        return chartBindAppInfoDao.getEntitysCount(param);
    }

    @Override
    public List findEntitysWithoutSub(Map<String, Object> param) {
        return null;
    }

    @Override
    public ChartBindAppInfoEntity getByKey(Long key) {
        return chartBindAppInfoDao.getByKey(key);
    }

    @Override
    public List<ChartBindAppInfoEntity> insertBatch(List<ChartBindAppInfoEntity> list) {
        chartBindAppInfoDao.insertBatch(list);
        return list;
    }


}
